import { BroadCastCall } from "../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../Framework/MQ/MessageBlock";
import { SLevelSealInfo } from "../../../../Message/Game/SLevelSealInfo";
import { LevelSealInfo } from "../../view/mainUI/info/LevelSealInfo";
import { NetDispatcher } from "../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../mvc/ServerCommand";
//class FirstReachLevelSealCommand
    
    export  class FirstReachLevelSealCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc1=null;
            var loc2=null;
            super.call(arg1);
            loc1 = arg1.messageBase as SLevelSealInfo;
            loc2 = new LevelSealInfo();
            loc2.level = loc1.curSealLevel;
            loc2.playerId = loc1.playerId;
            loc2.playerName = loc1.playerName;
            loc2.needDays = loc1.copyCloseDt;
            loc2.expAddPercent = loc1.expAdd;
            _cache.role.levelSealInfo = loc2;
            _cache.role.levelSealExpAddPercent = loc2.expAddPercent;
            NetDispatcher.dispatchCmd(ServerCommand.FirstReachLevelSealCommand, loc2);
            return;
        }
    }
